/*  Statement: http://acmp.ru/?main=task&id_task=146
   Verdict: Accepted
*/
import java.math.*;
import java.util.*;
import java.io.*;
 
public class Main {
        
    public BufferedReader in;
    public StringTokenizer stoken = new StringTokenizer("");
    public PrintWriter out;
        
    public static void main(String[] args) throws IOException {
        new Main();
    }  
    
    private final static BigInteger one = new BigInteger("1");
    private final static BigInteger two = new BigInteger("2");
    public static BigInteger sqrt(BigInteger v) {
    int n = v.toByteArray().length;
    byte[] b = new byte[n/2+1];
    b[0] = 1;
    BigInteger guess = new BigInteger(b);
    while(true) {
    BigInteger guessadd1 = guess.add(one);
    BigInteger guesssub1 = guess.subtract(one);
    if(guess.multiply(guess).compareTo(v) > 0) {
    if(guesssub1.multiply(guesssub1).compareTo(v) <= 0) {
    return guesssub1;
    }
    } else {
    if(guessadd1.multiply(guessadd1).compareTo(v) > 0) {
    return guess;
    }
    }
    guess = guess.add(v.divide(guess)).divide(two);
    }
    }
    
    Main() throws IOException{
        in = new BufferedReader(new FileReader("input.txt")); 
        out = new PrintWriter(new FileWriter("output.txt"));
        BigInteger n = new BigInteger(in.readLine());
        out.print(sqrt(n).toString());
        out.close(); 
    }
    
    private int nextInt() throws NumberFormatException, IOException {
        return Integer.parseInt(nextString());
    }

    private String nextString() throws IOException {
        while(!stoken.hasMoreTokens()){
            String st = in.readLine();
            stoken = new StringTokenizer(st);
        }
        return stoken.nextToken();
    }
    
} 

